
<div data-role="page">
<div data-role="navbar">
	<ul>
		<li><a href="<?php echo URL?>ratings">Rating</a></li>
		<li><a href="<?php echo URL?>matchs" class="ui-btn-active ui-state-persist">Matchs</a></li>               
	</ul>
</div><!-- /navbar -->
        <h2>Matchs</h2>
        <table class="tables" >
            <tr class="headline"><td>Team A</td><td></td><td>Team B</td><td></td><td>Result</td></tr>
            <tr class="headline"><td>P1</td><td>P2</td><td>P1</td><td>P2</td><td></td></tr>
            <?php
            $MatchsData = $this->model->PrintMathcsTable();

            $rowcount = 0;

            while ($matchdata = $MatchsData->fetch()) {

                $teamAP1Name = $matchdata['teamAP1Name'];
                $teamAP2Name = $matchdata['teamAP2Name'];
                $teamBP1Name = $matchdata['teamBP1Name'];
                $teamBP2Name = $matchdata['teamBP2Name'];
                $teamAScore = $matchdata['teamAScore'];
                $teamBScore = $matchdata['teamBScore'];
                $rowcount += 1;
                if ($rowcount % 2 == 1)
                    echo"<tr class=\"alt\">\n";
                else
                    echo"<tr>\n";
                echo"<td>$teamAP1Name</td><td>$teamAP2Name</td><td>$teamBP1Name</td><td>$teamBP2Name</td><td>$teamAScore - $teamBScore</td>\n";
                echo"</tr>\n";
            }
            ?>
        </table>
